Quantopian appears to have changed

by: JGSmith123, 9 years ago


Hello, it appears that Quantopian has changed something since you did your finance tutorial.

here is a portion of the code that you talked about in tutorial # 2


def handle_data(context,data):
    print(data)
    ma1 = data[context.security].mavg(50)
    ma2 = data[context.security].mavg(200)
    
    current_price = data[context.security].price
    current_positions = context.portfolio.positions[symbol('SPY')].amount
    cash = context.portfolio.cash


for ma1 & ma2, the moving averages did not come up as an automatic option like you mentioned in the tutorial. The variables current_price, current_positions, & cash all came up with the dropdown menus

Would you know where I should look to find out how to update the code to the new way Quantopian is working? Also, do you think it is still worth going through the tutorial with this change? For example, my goal is to learn python (and even use it in my already existent fx trading). So, if there are these changes within quantopian AND it doesn't appear to use standard python practices (classes that look like functions, etc), would you think it still makes sense to go through this particular tutorial. I will definitely go through all of you others. :)



You must be logged in to post. Please login or register an account.



Yep, it has changed to "Quantopian 2.0."

I plan to re-do the series, but it is still a bit away.

One option for now is to check out their migration guide: https://www.quantopian.com/quantopian2/migration

-Harrison 9 years ago

You must be logged in to post. Please login or register an account.